-
Notifications
You must be signed in to change notification settings - Fork 24.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renderer flag #37529
Renderer flag #37529
Conversation
e45c89f
to
bc13db9
Compare
This checks for a Bazel flag in `ng_module()` in the `_renderer` attribute which specifies the renderer to use for the build. The main advantage of this flag is that it can be overridden with [Bazel transitions](https://docs.bazel.build/versions/master/skylark/config.html), giving much more flexibility for migrating individual applications in a Bazel workspace to Ivy. This flag is not intended to replace `--config ivy` or `--define angular_ivy_enabled=True` (although it technically could). As a result, this flag is not and will not actually be used anywhere in the `angular/angular` repo. Instead, a `string_flag()` is provided internally which sets the renderer via a transition. See http://cl/315749946. Note that this does **not** introduce a dependency on Skylib for `angular/angular`. The dependency isn't actually necessary because `BuildSettingInfo` is not used externally anyways. By doing this, it is not necessary for downstream, external workspaces to depend on Skylib.
/cc @IgorMinar. |
Forced google3 passing as only failures appear to be flakes (View Engine, Ivy). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This checks for a Bazel flag in `ng_module()` in the `_renderer` attribute which specifies the renderer to use for the build. The main advantage of this flag is that it can be overridden with [Bazel transitions](https://docs.bazel.build/versions/master/skylark/config.html), giving much more flexibility for migrating individual applications in a Bazel workspace to Ivy. This flag is not intended to replace `--config ivy` or `--define angular_ivy_enabled=True` (although it technically could). As a result, this flag is not and will not actually be used anywhere in the `angular/angular` repo. Instead, a `string_flag()` is provided internally which sets the renderer via a transition. See http://cl/315749946. Note that this does **not** introduce a dependency on Skylib for `angular/angular`. The dependency isn't actually necessary because `BuildSettingInfo` is not used externally anyways. By doing this, it is not necessary for downstream, external workspaces to depend on Skylib. PR Close angular#37529
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This checks for a Bazel flag in `ng_module()` in the `_renderer` attribute which specifies the renderer to use for the build. The main advantage of this flag is that it can be overridden with [Bazel transitions](https://docs.bazel.build/versions/master/skylark/config.html), giving much more flexibility for migrating individual applications in a Bazel workspace to Ivy. This flag is not intended to replace `--config ivy` or `--define angular_ivy_enabled=True` (although it technically could). As a result, this flag is not and will not actually be used anywhere in the `angular/angular` repo. Instead, a `string_flag()` is provided internally which sets the renderer via a transition. See http://cl/315749946. Note that this does **not** introduce a dependency on Skylib for `angular/angular`. The dependency isn't actually necessary because `BuildSettingInfo` is not used externally anyways. By doing this, it is not necessary for downstream, external workspaces to depend on Skylib. PR Close angular#37529
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: http://b/158246077
Currently there is no way to set a particular
ng_module()
to build with View Engine or Ivy via a Bazel transition. Choosing a renderer is an "all or nothing" approach, where the entire compilation uses one renderer or the other.What is the new behavior?
ng_module()
now supports astring_flag()
being provided as a_renderer
attribute and will use it to decide whether to build with View Engine or Ivy. Such flags can be set via a transition on a per-target basis, making the flag much more flexible for migration use cases.Does this PR introduce a breaking change?
Other information
This flag is not intended for external use cases and will only ever be set inside google3. It is also not intended to replace
--config ivy
or--define angular_ivy_enabled=True
.See cl/315749946 for a g3 patch which adds the flag to be compatible with this PR.